<!doctype html>
<html lang="en">
<head>
    <title>Code coverage report for cjs/index.js</title>
    <meta charset="utf-8" />
    <link rel="stylesheet" href="../prettify.css" />
    <link rel="stylesheet" href="../base.css" />
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <style type='text/css'>
        .coverage-summary .sorter {
            background-image: url(../sort-arrow-sprite.png);
        }
    </style>
</head>
<body>
<div class='wrapper'>
  <div class='pad1'>
    <h1>
      <a href="../index.html">all files</a> / <a href="index.html">cjs/</a> index.js
    </h1>
    <div class='clearfix'>
      <div class='fl pad1y space-right2'>
        <span class="strong">100% </span>
        <span class="quiet">Statements</span>
        <span class='fraction'>76/76</span>
      </div>
      <div class='fl pad1y space-right2'>
        <span class="strong">100% </span>
        <span class="quiet">Branches</span>
        <span class='fraction'>26/26</span>
      </div>
      <div class='fl pad1y space-right2'>
        <span class="strong">100% </span>
        <span class="quiet">Functions</span>
        <span class='fraction'>6/6</span>
      </div>
      <div class='fl pad1y space-right2'>
        <span class="strong">100% </span>
        <span class="quiet">Lines</span>
        <span class='fraction'>74/74</span>
      </div>
      <div class='fl pad1y'>
        <span class="strong">16 statements, 1 function, 7 branches</span>
        <span class="quiet">Ignored</span>  &nbsp;&nbsp;&nbsp;&nbsp;
      </div>
    </div>
  </div>
  <div class='status-line high'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126</td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">15×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">2×</span>
<span class="cline-any cline-yes">2×</span>
<span class="cline-any cline-yes">2×</span>
<span class="cline-any cline-yes">3×</span>
<span class="cline-any cline-yes">3×</span>
<span class="cline-any cline-yes">2×</span>
<span class="cline-any cline-yes">2×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">10×</span>
<span class="cline-any cline-yes">2×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">6×</span>
<span class="cline-any cline-yes">6×</span>
<span class="cline-any cline-yes">6×</span>
<span class="cline-any cline-yes">6×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2×</span>
<span class="cline-any cline-yes">2×</span>
<span class="cline-any cline-yes">2×</span>
<span class="cline-any cline-yes">2×</span>
<span class="cline-any cline-yes">2×</span>
<span class="cline-any cline-yes">2×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2×</span>
<span class="cline-any cline-yes">2×</span>
<span class="cline-any cline-yes">2×</span>
<span class="cline-any cline-yes">2×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">2×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">3×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">2×</span>
<span class="cline-any cline-yes">2×</span>
<span class="cline-any cline-yes">2×</span>
<span class="cline-any cline-yes">2×</span>
<span class="cline-any cline-yes">2×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">4×</span>
<span class="cline-any cline-yes">4×</span>
<span class="cline-any cline-yes">4×</span>
<span class="cline-any cline-yes">4×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">4×</span>
<span class="cline-any cline-yes">4×</span>
<span class="cline-any cline-yes">4×</span>
<span class="cline-any cline-yes">4×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">'use strict';
/**
 * ISC License
 *
 * Copyright (c) 2018, Andrea Giammarchi, @WebReflection
 *
 * Permission to use, copy, modify, and/or distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
 * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
 * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 * PERFORMANCE OF THIS SOFTWARE.
 */
class QueryResult extends Array {}
const {create, defineProperty} = Object;
const AP = Array.prototype;
const DOM_CONTENT_LOADED = 'DOMContentLoaded';
const LOAD = 'load';
const NO_TRANSPILER_ISSUES = (new QueryResult) instanceof QueryResult;
const QRP = QueryResult.prototype;
// fixes methods returning non QueryResult
/* istanbul ignore if */
<span class="skip-if-branch" title="if path not taken" >I</span>if (!NO_TRANSPILER_ISSUES)
<span class="cstat-skip" title="statement not covered" >  Object.getOwnPropertyNames(AP).forEach(name =&gt; {</span>
<span class="cstat-skip" title="statement not covered" >    const desc = Object.getOwnPropertyDescriptor(AP, name);</span>
<span class="cstat-skip" title="statement not covered" >    if (typeof desc.value === 'function') {</span>
<span class="cstat-skip" title="statement not covered" >      const fn = desc.value;</span>
<span class="cstat-skip" title="statement not covered" >      desc.value = <span class="fstat-skip" title="function not covered" >function () {</span></span>
<span class="cstat-skip" title="statement not covered" >        const result = fn.apply(this, arguments);</span>
<span class="cstat-skip" title="statement not covered" >        return result instanceof Array ? patch(result) : result;</span>
      };
    }
<span class="cstat-skip" title="statement not covered" >    defineProperty(QRP, name, desc);</span>
  });
// fixes badly transpiled classes
const patch = NO_TRANSPILER_ISSUES ?
  qr =&gt; qr :
  /* istanbul ignore next */
<span class="branch-1 cbranch-skip" title="branch not covered" >  qr =&gt; {</span>
<span class="cstat-skip" title="statement not covered" >    const nqr = create(QRP);</span>
<span class="cstat-skip" title="statement not covered" >    push.apply(nqr, slice(qr));</span>
<span class="cstat-skip" title="statement not covered" >    return nqr;</span>
  };
const push = AP.push;
const search = (list, el) =&gt; {
  const nodes = [];
  const length = list.length;
  for (let i = 0; i &lt; length; i++) {
    const css = list[i].trim();
    if (css.slice(-6) === ':first') {
      const node = el.querySelector(css.slice(0, -6));
      if (node) push.call(nodes, node);
    } else
      push.apply(nodes, slice(el.querySelectorAll(css)));
  }
  return new QueryResult(...nodes);
};
const slice = NO_TRANSPILER_ISSUES ?
  patch :
  /* istanbul ignore next */
<span class="branch-1 cbranch-skip" title="branch not covered" >  all =&gt; {</span>
    // do not use slice.call(...) due old IE gotcha
<span class="cstat-skip" title="statement not covered" >    const nodes = [];</span>
<span class="cstat-skip" title="statement not covered" >    const length = all.length;</span>
<span class="cstat-skip" title="statement not covered" >    for (let i = 0; i &lt; length; i++)</span>
<span class="cstat-skip" title="statement not covered" >      nodes[i] = all[i];</span>
<span class="cstat-skip" title="statement not covered" >    return nodes;</span>
  }
// use function to avoid usage of Symbol.hasInstance
// (broken in older browsers anyway)
const $ = function $(CSS, parent = document) {
  switch (typeof CSS) {
    case 'string': return patch(search(CSS.split(','), parent));
    case 'object':
      // needed to avoid iterator dance (breaks in older IEs)
      const nodes = [];
      const all = ('nodeType' in CSS || 'postMessage' in CSS) ? [CSS] : CSS;
      push.apply(nodes, slice(all));
      return patch(new QueryResult(...nodes));
    case 'function':
      const $parent = $(parent);
      const $window = $(parent.defaultView);
      const handler = {handleEvent(event) {
        $parent.off(DOM_CONTENT_LOADED, handler);
        $window.off(LOAD, handler);
        CSS(event);
      }};
      $parent.on(DOM_CONTENT_LOADED, handler);
      $window.on(LOAD, handler);
      const rs = parent.readyState;
      if (rs == 'complete' || (rs != 'loading' &amp;&amp; !parent.documentElement.doScroll))
        setTimeout(() =&gt; $parent.dispatch(DOM_CONTENT_LOADED));
      return $;
  }
};
$.prototype = QRP;
$.extend = (key, value) =&gt;
            (defineProperty(QRP, key, {configurable: true, value}), $);
// dropped usage of for-of to avoid broken iteration dance in older IEs
$.extend('dispatch', function dispatch(type, init = {}) {
  const event = new CustomEvent(type, init);
  const length = this.length;
  for (let i = 0; i &lt; length; i++)
    this[i].dispatchEvent(event);
  return this;
})
.extend('off', function off(type, handler, options = false) {
  const length = this.length;
  for (let i = 0; i &lt; length; i++)
    this[i].removeEventListener(type, handler, options);
  return this;
})
.extend('on', function on(type, handler, options = false) {
  const length = this.length;
  for (let i = 0; i &lt; length; i++)
    this[i].addEventListener(type, handler, options);
  return this;
});
&nbsp;
Object.defineProperty(exports, '__esModule', {value: true}).default = $;
&nbsp;</pre></td></tr>
</table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
  Code coverage
  generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Wed Sep 26 2018 15:30:52 GMT+0100 (BST)
</div>
</div>
<script src="../prettify.js"></script>
<script>
window.onload = function () {
        if (typeof prettyPrint === 'function') {
            prettyPrint();
        }
};
</script>
<script src="../sorter.js"></script>
</body>
</html>
